package com.wicket.okrbff.biz.service.nb;

import com.wicket.okrbff.biz.service.dto.req.BatchClearUserInfoFromRedisReqDto;
import com.wicket.okrbff.biz.service.dto.res.BatchClearUserInfoFromRedisRespDto;
import com.wicket.okrbff.common.util.RedisUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author ： 手工接入方法
 * @since 2022/5/28 15:32
 *
 *
 * @version 1.0
 */
@Service
public class NbRole {

    @Resource
    private RedisUtil redisClient;

    /**
     * code:batchClearUserInfoFromRedis
     * name:Redis批量清空用户信息
     * desc:undefined
     **/
    public BatchClearUserInfoFromRedisRespDto batchClearUserInfoFromRedis(BatchClearUserInfoFromRedisReqDto reqDto) {
        BatchClearUserInfoFromRedisRespDto retData = new BatchClearUserInfoFromRedisRespDto();
        if (reqDto.getBeginMemberList() == null || reqDto.getBeginMemberList().isEmpty()) {
            return retData;
        }
        for (String member : reqDto.getBeginMemberList()) {
            redisClient.delete("userbase-" + member);
            redisClient.delete("inductionInfo-" + member);
        }
        return retData;
    }
    //手工接入方法
}
